/*****************************************************************************/
/**
*
* @file bsp_misc.c
*
* User defined functions about USART of stm32.
* Target device: STM32F103RET6.
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver   Who    Date   	Changes
* ----- ---- ---------- -------------------------------------------------------
* 0.01  abu  02/14/2020 Created
* </pre>
*
*------------------------------------------------------------------------------
* Author:	abu
*					E-mail:	abu_liu@opencores.org
*------------------------------------------------------------------------------
*
******************************************************************************/

/***************************** Include Files *********************************/
#include "bsp_misc.h"

/************************** Function Prototypes ******************************/

/*****************************************************************************/
/**
*
* @brief	Initialise mcu.
* @brief	Peripheral devices, such as esp8266, are not initialised here.
*
* @param	None.
* @param  None.	
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
void HardWare_Init(void)
{
	USART1_Init(115200);
	EXTI_Configuration();
	SysTick_Init();
	led_init();
	beep_init();
	key_init();
	
	ESP8266_Init();
	delay(1000);
	
	Debug_print("HardWare init finished.\n\r");
}

/*****************************************************************************/
/**
*
* @brief	Delay nMs, using null operation.
* @brief	nMs may not be accurate.
*
* @param	nMs: n ms, delay time.
* @param  None.	
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
void Delay(unsigned int nMs)
{
	int i,j;
	for(i=0;i<10000;i++)
		for(j=0;j<nMs;j++)
			;
}